/**
 * 
 */
package com.naiterui.ehp.bp.utils.biz;

/**
 * @Description 职称类
 */
public class TitleUtil {

    /**
     * 根据ID获取职称
     * <详细描述>
     * @param id
     * @return String <返回值描述>
     * @Throws 异常信息
     * @History 2015-6-20 下午2:31:30 by guoyongxiang
     */
    public static String getTitle(Integer id) {
        Enum[] teArr = Enum.values();
        for (Enum te : teArr) {
            if (te.getId().equals(id)) {
                return te.getName();
            }
        }
        return "";
    }

    public enum Enum {

        MAIN_HOSPITAL_PHYSICIAN (4, "住院医师"),
        PHYSICIAN (0, "医师"),
        ATTENDING_PHYSICIAN (3, "主治医师"),
        DEPUTY_CHIEF_PHYSICIAN (1, "副主任医师"),
        CHIEF_PHYSICIAN (2, "主任医师");

        /** 职称编号 */
        private Integer id;
        /** 职称名称 */
        private String name;

        Enum(Integer id, String name) {
            this.id = id;
            this.name = name;
        }

        public Integer getId() {
            return this.id;
        }

        public String getName() {
            return this.name;
        }
    }

}
